import request from '@/util/request'

/*
* 请求电子书列表
*/
export function ebookList(data:any = null){
    return request({
        url:'/ebook/list',
        method:'get',
        params:data
    })
}

/**
 * 新增/编辑电子书
 */
export function ebookSave(data:any = null){
    return request({
        url:'/ebook/save',
        method:'post',
        data:data
    })
}

/**
 * 删除电子书列表
 */
export function ebookDel(data:any = null){
    return request({
        url:'/ebook/del/'+data,
        method:'delete',
        data:data
    })
}

/**
 * 分类列表
 */
export function categoryList(data:any = null){
    return request({
        url:'/category/list',
        method:'get',
        params:data
    })
}

/**
 * 查询所有的分类
 */
export function categoryAll(data:any = null){
    return request({
        url:'/category/all',
        method:'get',
        params:data
    })
}
/**
 * 新增/编辑分类
 */
export function categorySave(data:any = null){
    return request({
        url:'/category/save',
        method:'post',
        data:data
    })
}

/**
 * 删除电子书列表
 */
export function categoryDel(data:any = null){
    return request({
        url:'/category/del/'+data,
        method:'delete',
        data:data
    })
}

/**
 * 查询所有的分类
 */
export function docAll(data:any = null){
    return request({
        url:'/doc/all/'+data,
        method:'get',
    })
}
/**
 * 新增/编辑分类
 */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function docSave(data:any = null){
    return request({
        url:'/doc/save',
        method:'post',
        data:data
    })
}

/**
 * 删除电子书列表
 */
export function docDel(data:any = null){
    return request({
        url:'/doc/del/'+data,
        method:'delete',
        data:data
    })
}
/**
 * 根据列表id获取内容
 */
export function idByContent(data:any = null){
    return request({
        url:'/doc/find-content/'+data,
        method:'delete',
        data:data
    })
}
/**
 * 查询用户列表
 */
 export function userList(data:any = null){
  return request({
      url:'/user/list',
      method:'get',
      params:data
  })
}
/**
 * 用户新增/编辑
 */
 export function userSave(data:any = null){
  return request({
      url:'/user/save',
      method:'POST',
      data:data
  })
}
/**
 * 删除用户
 */
 export function userDel(data:any = null){
  return request({
      url:'/user/del/'+data,
      method:'delete',
  })
}